import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

  {
    path: "/",
    redirect: "/home",
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    children: [
      {
        path: 'products', component: () => import('../views/HomeView.vue')
      },
      {
        path: '/home/add/',
        component: () => import('../views/add.vue')
      },
      {
        path: '/home/edit/',
        component: () => import('../views/add.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: "history",
  routes
})

export default router
